from RotationCipher import RotationCipherSolver

question1Query = "Esp qtcde nzyqpcpynp zy esp ezatn zq Lcetqtntlw Tyepwwtrpynp hld spwo le Olcexzfes Nzwwprp ty estd jplc."

decoder = RotationCipherSolver(debugging=False) #create a new instance of RotationCipher

decoder.newQuery(question1Query) #send the query to the decoder

#print(decoder.get_belief_state()) #print out the belief state

#decoder.print_belief_states()

#print(decoder.print_library_book()) #print the parsed library book

#print(decoder.get_library_bigrams_counts()) #prints the counts for the library book

#print(decoder.get_state_scores()) #prints the scores for the states

print(decoder.get_state_by_max_score()) #should print the correct result

"""
Another query
Generated from http://www.rot-n.com/
"""

decoder.newQuery("Guvf vf erpbeqrq ba ehfg naq fgvpxl gncr")

print(decoder.get_state_by_max_score())

"""
Another very short query
"""

decoder.newQuery("Jub yrg gur qbtf bhg!")

print(decoder.get_state_by_max_score())

"""
A query encoded and then decoded
"""

message = decoder.shift_encode("Action is the real measure of intelligence. ", 20)

print(message)

decoder.newQuery(message)

print(decoder.get_state_by_max_score())



